package com.useeinfo.oa.modules.maintaining.enums;

import com.useeinfo.oa.modules.repair.enums.RepairOrderStatusEnum;

/**
 * @Auther: 陈炜
 * @Date: 2018/12/29 16:47
 * @Description:输入类型枚举类
 */
public enum InputTypeEnum {

    TEXT("TEXT","文字"),
    NUMBER("NUMBER","数字"),
    IS_NORMAL("IS_NORMAL","正常与否"),
    COMPLETE_TYPE("COMPLETE_TYPE","完成正常、异常、未完成、无此项目"),
    STATUS_TYPE("STATUS_TYPE","良好、需处理（能运转）、需处理（不能运转）、处理后良好"),
    SWITCH("SWITCH","开/关")
    ;

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    InputTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static InputTypeEnum getEnum(String name){
        if(name.equals("文字")){
            return TEXT;
        }else if(name.equals("数字")){
            return NUMBER;
        }else if(name.equals("正常与否")){
            return IS_NORMAL;
        }else if(name.equals("完成正常、异常、未完成、无此项目")){
            return COMPLETE_TYPE;
        }else if(name.equals("良好、需处理（能运转）、需处理（不能运转）、处理后良好")){
            return STATUS_TYPE;
        }else if(name.equals("开/关")){
            return SWITCH;
        }else{
            return null;
        }
    }
}
